package com.zkc;

public class Test {
    public static void main(String[] args) {
        Animal an = new Animal();
        Dog dog = new Dog();
    }
}
class Animal{
    String name;
    {
        System.out.println("我是动物");
    }
    public Animal()
    {
        this.name = "动物";
        System.out.println("无参构造方法");
    }
}
class Dog extends Animal{
    public Dog(){
        this.name = "狗";
        System.out.println("我是" + name);
    }
}